]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Allow some shortcuts on lock screen
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 21 Aug 2022 19:17:18 +0000 (21:17 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 22 Aug 2022 14:15:17 +0000 (14:15 +0000)
We will expose the screenshot UI from quick settings, including
on the lock screen. It would be odd to restrict keyboard shortcuts
more than the more accessible UI, so relax the modes for the
screenshot-ui and screen-screenshot shortcuts.

We still disable all screenshot shortcuts on the login screen, as
users don't have an obvious way to retrieve the screenshot files.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2439>

js/ui/screenshot.js

index e6ead6127390599f828001d44e15a20874bfa8d4..d43bf0dc7f11d8a5126c28d3440ae4cdc600f4ee 100644 (file)
@@ -1285,10 +1285,10 @@ var ScreenshotUI = GObject.registerClass({
         });
 
         const uiModes =
-            Shell.ActionMode.ALL &
-            ~(Shell.ActionMode.LOCK_SCREEN |
-                Shell.ActionMode.UNLOCK_SCREEN |
-                Shell.ActionMode.LOGIN_SCREEN);
+            Shell.ActionMode.ALL & ~Shell.ActionMode.LOGIN_SCREEN;
+        const restrictedModes =
+            uiModes &
+            ~(Shell.ActionMode.LOCK_SCREEN | Shell.ActionMode.UNLOCK_SCREEN);
 
         Main.wm.addKeybinding(
             'show-screenshot-ui',
@@ -1302,7 +1302,7 @@ var ScreenshotUI = GObject.registerClass({
             'show-screen-recording-ui',
             new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
             Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
-            uiModes,
+            restrictedModes,
             showScreenRecordingUI
         );
 
@@ -1310,7 +1310,7 @@ var ScreenshotUI = GObject.registerClass({
             'screenshot-window',
             new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
             Meta.KeyBindingFlags.IGNORE_AUTOREPEAT | Meta.KeyBindingFlags.PER_WINDOW,
-            uiModes,
+            restrictedModes,
             async (_display, window, _binding) => {
                 try {
                     const actor = window.get_compositor_private();